url = 'https://www.acwing.com/problem/content/4864/'


n = int(input())

for i in range(n):
    x = int(input())
    res = []
    c = 1
    while x>0:
        t = x% (10**c)
        x -= t
        if t>0:
            res.append(str(t))
        c+=1
    print(len(res))
    print(*res)

